// import 'package:flutter_foreground_task/flutter_foreground_task.dart';
// import 'package:geolocator/geolocator.dart';
// import '../utils/index.dart' show LogUtil;
// import '../../utils/gps/gps_util.dart';
//
//
// class ForegroundGeolocationTaskHandler extends TaskHandler{
//
//   // Called when the task is started.
//   @override
//   Future<void> onStart(DateTime timestamp, TaskStarter starter) async {
//     LogUtil.d('foreground onStart(starter: ${starter.name})');
//     Future<Position> fp = GpsUtil.determinePosition();
//     fp.then((p) {
//       LogUtil.d('foreground 获取到的GPS：${p.longitude} : ${p.latitude}');
//     }).catchError((msg){
//
//     });
//   }
//
//   // Called based on the eventAction set in ForegroundTaskOptions.
//   @override
//   void onRepeatEvent(DateTime timestamp) {
//     // Send data to main isolate.
//     final Map<String, dynamic> data = {
//       "timestampMillis": timestamp.millisecondsSinceEpoch,
//     };
//     FlutterForegroundTask.sendDataToMain(data);
//   }
//
//   // Called when the task is destroyed.
//   @override
//   Future<void> onDestroy(DateTime timestamp) async {
//     LogUtil.d('onDestroy');
//   }
//
//   // Called when data is sent using `FlutterForegroundTask.sendDataToTask`.
//   @override
//   void onReceiveData(Object data) {
//     LogUtil.d('onReceiveData: $data');
//   }
//
//   // Called when the notification button is pressed.
//   @override
//   void onNotificationButtonPressed(String id) {
//     LogUtil.d('onNotificationButtonPressed: $id');
//   }
//
//   // Called when the notification itself is pressed.
//   @override
//   void onNotificationPressed() {
//     LogUtil.d('onNotificationPressed');
//   }
//
//   // Called when the notification itself is dismissed.
//   @override
//   void onNotificationDismissed() {
//     LogUtil.d('onNotificationDismissed');
//   }
//
//
//
// }